﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;



namespace EntranceApp
{
    class DBhelper
    {
        MySqlConnection Sqlconnection;
        string sqlString = "server=athena01.fhict.local;" +
                             "database=dbi290840;" + // your database name
                             "user id=dbi290840;" + // your user id
                             "password=yEHnec1M6Z;" + // your password
                             "connect timeout=30;";
        public string SqlString { get { return sqlString; } set { sqlString = value; } }
        public void connect()
        {
            try
            {
                Sqlconnection = new MySqlConnection(sqlString);
                Sqlconnection.Open();
            }
            catch (MySqlException ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            finally
            {
                if (Sqlconnection != null)
                    Sqlconnection.Close();
            }
        }
    }
}

